/*
 Rilego - An easy Images 2 E-Book converter.
Copyright (C) 2011  Federico Improta (Kirys)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/

package it.kirys.rilego.engine.loaders.imagesources;

import it.kirys.rilego.engine.project.Project;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;

/**
 *
 * @author Federico Improta
 */
public class ReaderAndTransformer {
	private Project project;

	private BufferedImage loadFromSource(IImageSource source) throws IOException{
		// todo: this is a stub
		return ImageIO.read(source.getStream());
	}

	public BufferedImage[] process (IImageSource source) throws IOException{
		BufferedImage[] out;
		BufferedImage in = loadFromSource(source);

		if (source.getTransformations().isSplit()){
			// we have to split the source
			out = new BufferedImage[2];
		} else {
			//the source has to be taken as is.
			out = new BufferedImage[]{in};
		}
		for (int i =0; i<out.length;i++){

		}
		return out;
	}//public BufferedImage[] process (IImageSource source)

	public ReaderAndTransformer(Project project) {
		this.project = project;
	}//private BufferedImage loadFromSource(IImageSource source)



}
